<?php
declare (strict_types=1);

namespace app\exam\model\admin;

use app\common\model\BaseModel;

/**
 * Class ModuleSpecialTopic
 *
 * @package app\exam\model\admin
 */
class ModuleSpecialTopic extends BaseModel
{
    /**
     * 表名
     *
     * @var string
     */
    protected $name = 'exam_module_special_topic';

    /**
     * 关联试题信息
     * Author: Martinsun <syh@sunyonghong.com>
     * Date: 2021/2/1
     *
     * @return \think\model\relation\BelongsTo
     */
    public function topic()
    {
        return $this
            ->belongsTo(QuestionTopic::class, 'topic_id', 'id')
            ->with(['difficultyTitle', 'questionBankTitle'])
            ->bind(['title', 'num', 'answer_num', 'question_type_text', 'difficulty_title', 'question_bank_title']);
    }

}